package top.xana.acg.anime.database

import androidx.lifecycle.LiveData
import androidx.room.*
import androidx.room.OnConflictStrategy.IGNORE

/**
 * @author xana
 * @date 2022/5/23 0023 15:04
 * @email cv4096@qq.com
 **/
@Dao
interface AnimeDao {
    companion object {
        const val TAG = "AnimeDao"
    }

    @Insert(onConflict = IGNORE)
    fun add(anime: AnimeEntity)

    @Delete
    fun del(anime: AnimeEntity)

    @Query("SELECT uri, title, cover, status, src FROM tb_anime")
    fun queryAll(): LiveData<List<AnimeEntity>>

    @Update(onConflict = IGNORE)
    fun tran(anime: AnimeEntity)
}